import { AxiosResponse } from "axios";
import { JxtechCodeListResult, JxtechTreeResult } from "@whjxtech/jxtech-component";
import service from "@/api";
import { SERVICE_CONFIG } from "../_base";

/**
 * 数据字典查询
 * @param codeItemId 数据字典类型id
 * @returns
 */
export function commonList(codeItemId: string): Promise<AxiosResponse<JxtechCodeListResult[]>> {
  var url = SERVICE_CONFIG.ORG + "/org/codeList/common_list/" + codeItemId;
  return service.get(url);
}

/**JxtechDictionaryCascaderExt远程级联选择器接口 */
export function commonListCascader(codeItemId: string): Promise<AxiosResponse<JxtechTreeResult<any>[]>> {
  var url = SERVICE_CONFIG.ORG + "/org/codeList/common_list";
  return service.get(url, { params: { codeName: codeItemId, allData: true } });
}
